/**
 * createTime: 2018/4/17 14:35
 * author: zhibin.zhao
 * description:
 */
const Koa = require('koa');
const views = require('koa-views');
const path = require('path');
const app = new Koa();

app.use(views(path.join(__dirname, './view'),{
    extension: 'ejs'
}))

app.use(async(ctx)=>{
    let title = 'hello world!!!';
    await ctx.render('index', {title})
});
app.listen(3000, ()=>{
    console.log('app is starting at port 3000');
})